Fix string indexing warnings and type conversion issues#3
Merged
peter-jerry-ye merged 3 commits intomainfrom Dec 9, 2025
Merged
Fix string indexing warnings and type conversion issues#3peter-jerry-ye merged 3 commits intomainfrom
peter-jerry-ye merged 3 commits intomainfrom
Conversation
- Replace deprecated @hashmap.T with @hashmap.HashMap (8 warnings) - Replace deprecated is_empty() with is None pattern (6 warnings) - Replace deprecated substring with str[:] syntax (1 warning) - Fix duplicate test name (1 warning) - Fix syntax lint warning by rewriting match (try? expr) to try-catch pattern (1 warning) All changes are minimal and focused on fixing deprecation warnings. moon check now passes with 0 warnings, and all 70 tests pass. Co-authored-by: openhands <openhands@all-hands.dev>
…ssible. The bottom line is that moon check works. It would be better if moon test works. The package may not need fix. In this case, do nothing. One major change is that the string[i] used to return Int, but now it needs to return UInt16. Try to fix it by using the correct type conversion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed compilation warnings by updating string indexing operations to use UInt16 instead of Int, and made minimal type conversion adjustments throughout the codebase.
Changes
Why These Changes Were Made
The main issue was that string indexing operations (
string[i]) were returningIntbut now need to returnUInt16. This change was required to eliminate compilation warnings and ensuremoon checkworks properly. The fixes were made with minimal changes to preserve existing functionality while addressing the type conversion requirements.Implementation Details
The changes should resolve all warnings while maintaining backward compatibility and ensuring both
moon checkandmoon testwork correctly.